//
//  ForgetPassWordViewController.m
//  VTravel
//
//  Created by lanouhn on 16/8/1.
//  Copyright © 2016年 xiaoYu. All rights reserved.
//

#import "ForgetPassWordViewController.h"

@interface ForgetPassWordViewController ()

/** 手机号输入框 */
@property (strong, nonatomic) IBOutlet UITextField *phoneTextField;
/** 短信验证码输入框 */
@property (strong, nonatomic) IBOutlet UITextField *SecurityTextField;

@end

@implementation ForgetPassWordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 配置导航栏
    self.navigationItem.title = @"忘记密码";
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"登录注册返回键"] style:(UIBarButtonItemStyleDone) target:self action:@selector(handleBackAction)] ;
    self.navigationItem.leftBarButtonItem = leftItem;
    
    // 配置手机号输入框
    UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)];
    imageView1.image = [UIImage imageNamed:@"登录注册手机号"];
    self.phoneTextField.leftView = imageView1;
    self.phoneTextField.leftViewMode = UITextFieldViewModeAlways;
    
    // 配置验证码输入框
    UIImageView *imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)];
    imageView2.image = [UIImage imageNamed:@"登录注册手机号验证"];
    self.SecurityTextField.leftView = imageView2;
    self.SecurityTextField.leftViewMode = UITextFieldViewModeAlways;
    
    UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
    button.frame = CGRectMake(0, 0, 110, 30);
    [button setBackgroundImage:[UIImage imageNamed:@"登录注册发送验证码"] forState:(UIControlStateNormal)];
    [button setTitle:@"发送验证码" forState:(UIControlStateNormal)];
    button.titleLabel.font = [UIFont systemFontOfSize:12];
    [button setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
    [button addTarget:self action:@selector(handleSendSecurity) forControlEvents:(UIControlEventTouchUpInside)];
    self.SecurityTextField.rightView = button;
    self.SecurityTextField.rightViewMode = UITextFieldViewModeAlways;

}

#pragma mark - 点击发送验证码事件
- (void)handleSendSecurity{
    kMyLog(@"向手机发送验证码");
}

#pragma mark - 返回点击事件
- (void)handleBackAction{
    kMyLog(@"返回登录界面");
    [self.navigationController popViewControllerAnimated:YES];
}




@end
